bitkeeper revision 1.1713.3.2 (42b296adTFf-i3SL6NuYF5MX4ai91Q)
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 17 Jun 2005 09:23:57 +0000 (09:23 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Fri, 17 Jun 2005 09:23:57 +0000 (09:23 +0000)
Makefile:
  Build libxenstore-pic.a.
setup.py:
  Link with libxenstore-pic.a.
Makefile:
  Build libxc-pic.a.
  Build xenstore once is enough.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/Makefile
tools/libxc/Makefile
tools/python/setup.py
tools/xenstore/Makefile

index b122ba465af1f4314a2e0b76086c7fb6dfe3c112..3a38e899de07c5cb3c70c72f30b76ec99eea14da 100644 (file)
@@ -10,7 +10,6 @@ SUBDIRS += xentrace
 SUBDIRS += python
 SUBDIRS += xcs
 SUBDIRS += xcutils
-SUBDIRS += xenstore
 SUBDIRS += pygrub
 SUBDIRS += firmware
 
index cbe7983a44d965e47c8d2f1f65f4a2ed7288fe8c..e8c6058b7d052c9be8c5a35b54e4fe06d1f02e95 100644 (file)
@@ -44,7 +44,8 @@ DEPS     = .*.d
 LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
 PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
 
-LIB      := libxc.a libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
+LIB      := libxc.a libxc-pic.a
+LIB      += libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
 
 all: build
 build: check-for-zlib mk-symlinks
@@ -98,6 +99,9 @@ rpm: build
 libxc.a: $(LIB_OBJS)
        $(AR) rc $@ $^
 
+libxc-pic.a: $(PIC_OBJS)
+       $(AR) rc $@ $^
+
 libxc.so: libxc.so.$(MAJOR)
        ln -sf $< $@
 libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
index fabe80bd8bceaf53172a8ed6037ff2a7bf8ca816..e2a5b09ca15a9f13bce2f84ea318d3dbe2951184 100644 (file)
@@ -17,7 +17,7 @@ library_dirs = [ XEN_ROOT + "/tools/libxc",
                  XEN_ROOT + "/tools/xenstore",
                  ]
 
-libraries = [ "xc", "xenstore" ]
+libraries = [ "xc", "xenstore-pic" ]
 
 xc = Extension("xc",
                extra_compile_args = extra_compile_args,
index 408078efbae62b54567c0d1c29994dca26116728..3bfe8cb9570f6d0a1ae620e8377bc7880789589e 100644 (file)
@@ -20,15 +20,12 @@ BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
 BASECFLAGS+= -I.
 
 CFLAGS += $(BASECFLAGS)
-ifeq ($(XEN_TARGET_ARCH),x86_64)
-CFLAGS += -fPIC
-endif
 LDFLAGS=$(PROFILE) -L$(XEN_LIBXC)
 TESTDIR=`pwd`/testsuite/tmp
 TESTFLAGS=-DTESTING
 TESTENV=XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
 
-all: xen xenstored libxenstore.a
+all: xen xenstored libxenstore.a libxenstore-pic.a
 
 testcode: xen xs_test xenstored_test xs_random
 
@@ -56,10 +53,18 @@ xs_test_lib.o: xs.c
 talloc_test.o: talloc.c
        $(COMPILE.c) -o $@ $<
 
-libxenstore.a: libxenstore.a(xs.o) libxenstore.a(xs_lib.o)
+LIB_OBJS     := xs.o xs_lib.o
+
+LIB_OBJS_A   := $(patsubst %.o,libxenstore.a(%.o),$(LIB_OBJS))
+LIB_OBJS_PIC := $(patsubst %.o,libxenstore-pic.a(%.opic),$(LIB_OBJS))
+
+libxenstore.a: $(LIB_OBJS_A)
+
+libxenstore-pic.a: $(LIB_OBJS_PIC)
 
 clean: testsuite-clean
-       rm -f *.o *.a xs_test xenstored xenstored_test xs_random xs_stress xen
+       rm -f *.o *.opic *.a
+       rm -f xs_test xenstored xenstored_test xs_random xs_stress xen
        -$(RM) $(PROG_DEP)
 
 check: testsuite-run randomcheck stresstest
@@ -88,7 +93,7 @@ TAGS:
 tarball: clean
        cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
 
-install: xenstored libxenstore.a
+install: xenstored libxenstore.a libxenstore-pic.a
        $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
        $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
        $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
@@ -96,7 +101,11 @@ install: xenstored libxenstore.a
        $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
        $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
        $(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
+       $(INSTALL_DATA) libxenstore-pic.a $(DESTDIR)/usr/$(LIBDIR)
        $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
        $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
 
 -include $(PROG_DEP)
+
+# never delete any intermediate files.
+.SECONDARY: